<?php
if (empty ($res)) {
    echo "Tidak ada data";
}
else {
?>
<style>
	h4 {
		font-size:20px;
		font-weight:bold;
		margin:0px;
		margin-bottom:5px;
	}
	page{
		border:1px solid black;
	}
	p{
		margin:5px;
	}
	.header{
		width:95%;
		border-bottom:2px double black;
		padding:10px 0;
	}
	.header img{
		width:100px;
		height:auto;
	}
</style>
<page backtop="20mm" backbottom="10mm" backleft="1mm" backright="3mm">
    <page_header>
        <table class="header" cellspacing=0 cellpadding=0>
            <tr>
                <td style="text-align: left;   width: 10%"><img src='<?php base_url()?>asset/images/logo.png' width="10px" height="10px"/></td>
				<td style="text-align: center; width: 80%">
					<h4><?php echo $nama_sekolah;?></h4>
					<p><?php echo $alamat_sekolah;?></p>
				</td>
                <td style="text-align: right;   width: 10%"><?php //echo date('d/m/Y'); ?></td>
            </tr>
        </table>
    </page_header>
    <page_footer>
        <table style="width: 100%; border: solid 1px black;">
            <tr>
                <td style="text-align: left;    width: 50%"><?=$nama_sekolah?></td>
                <td style="text-align: right;    width: 50%">page [[page_cu]]/[[page_nb]]</td>
            </tr>
        </table>
    </page_footer>
	<!--<table style="width:100%;">-->
	<p align="center"><h4>Surat Bukti Daftar Ulang</h4><br><?=date('d/m/Y')?></p>
	<!--<p align="center"><?php  echo $data_pdf[0]->nama_tahunajaran;?></p>-->
	<br/> 
	<table width= "800" border="0">
	  <tr>
		<td width="100">No Pendaftaran</td>
		<td width="10">:</td>
		<td width=""><?=$res->row()->no_pendaftaran?></td>
	  </tr>
	  <tr>
		<td>Nama</td>
		<td>:</td>
		<td><?=$res->row()->nama?></td>
	  </tr>
	  <tr>
		<td>Tmp/Tgl Lahir</td>
		<td>:</td>
		<td><?=$res->row()->tmp_lahir.' / '.$res->row()->tgl_lahir?></td>
	  </tr>
	  <tr>
		<td>Tlp</td>
		<td>:</td>
		<td><?=$res->row()->tlp?></td>
	  </tr>
	  <tr>
		<td>Alamat</td>
		<td>:</td>
		<td><?=$res->row()->alamat?></td>
	  </tr>
	</table>
	<br>
	<p align="center"><b>Pembayaran</b></p>
	<table border="0" cellpadding="2" cellspacing="2" width="700px" align="center">
		<tr>
			<td width="30px"><b>No.</b></td>
			<td width="400px"><b>Rincian</b></td>
			<td width="20px">&nbsp;</td>
			<td width="90px">Nominal</td>
		</tr>
		<?php 
			$i=1;
			$total=0;
			foreach($pembayaran->result() as $row){
		?>
		<tr>
			<td valign="top"><?=$i?></td>
			<td valign="top"><?=$row->pembayaran?></td>
			<td valign="top" align="right">Rp.</td>
			<td valign="top" align="right"><?=$row->nominal?></td>
		</tr>
		<?php
				$total += $row->nominal;
				$i++;
			}
			$total += $uang_sumbangan;
			
		?>
		<tr>
			<td valign="top"><?=$i?></td>
			<td valign="top">Uang Sumbangan</td>
			<td valign="top" align="right">Rp.</td>
			<td valign="top" align="right"><?=$uang_sumbangan?></td>
		</tr>
		<tr>
			<td></td>
			<td align="right"><b>Total&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></td>
			<td>Rp.</td>
			<td align="right"><b><?=$total?></b></td>
		</tr>
	</table>
</page>
<?php } ?>